package com.sc;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 调用一下服务:http://localhost:port/up?up=false，
 * 将此时查看http://localhost:port/health,整个应用的health状态变成DOWN了：
 * 注册中心的服务状态也将变为DOWN
 *
 */
@RestController
public class UpController {

    @Autowired
    MyHealthChecker myHealthChecker;

    @RequestMapping("/up")
    public String up(@RequestParam("up") Boolean up) {
        myHealthChecker.setUp(up);

        return up.toString();
    }



}
